JCardWidgetOption = {
    cardShowUrl:'',
};
function JCardWidget (options){
  
  JWidget.apply(this,arguments);

}
JCardWidget.prototype.__proto__ = JWidget.prototype;

JCardWidget.prototype.init = function(){
  /*
   * 调用父类方法
   */
  JWidget.prototype.init.apply(this,arguments);
  
  this.name='123';
  
 };
 
 JCardWidget.prototype.run = function(){
	  /*
	   * 调用父类方法
	   */
	  JWidget.prototype.run.apply(this,arguments);
	  this.show();
	};
	
	/**
	 * invoke controller.show to display weibo content.
	 * @return
	 */
	JCardWidget.prototype.show = function(){
		
		this.core.load(JCardWidgetOption.cardShowUrl);
	};
	
	JCardWidget.prototype.initConfigBar = function(){
		JWidget.prototype.initConfigBar.apply(this,arguments);
		
		
	 	if(typeof this.fields.name == 'undfined'){
			this.fields.name ='';
		}
	 	
	 	var me = this;
		
    var nameFamily = $('<select/>').addClass('dropDownFamily').append($('<option/>').attr('value','宋体').text('宋体'))
                      .append($('<option/>').attr('value','黑体').text('黑体'))
                      .append($('<option/>').attr('value','微软雅黑').text('微软雅黑'))
                      .append($('<option/>').attr('value','楷体').text('楷体'))
                      .append($('<option/>').attr('value','Arial').text('Arial'))
                      .append($('<option/>').attr('value','Arial Black').text('Arial Black'))
                      .append($('<option/>').attr('value','Times New Roman').text('Times New Roman'))
              .css({width:'80px'})
              .change(function(){
                // me.style('font-family',this.value );
                me.dom.find('.card_name').css('font-family', this.value ); 
                
              });
    var nameFontSize  = {
        value:16,
        min:10,
        max:40,
        slide:function(event, ui){
            $name =  $(this).attr('name');
            me.dom.css($name,  ui.value +'px'); 
          },
        stop:function(event, ui){
            $name =  $(this).attr('name');
            me.style ($name , ui.value +'px');
          }
      };
		var nameFontClolr=$('<div><div/>').addClass('colorbutton').click(function(){me.pickerColor(me.dom.find('.card_name'),'color');});
		var nameContent=$("<input type='text' maxlength='50'></input>")//.val("起个名字")
		                //.click(function(){if(this.value == '起个名字'){this.value = '';} return false;})
		                .css({border:'1px solid'}).keyup(function(){
                          me.dom.find('.card_name').val($(this).val());})
                    .blur(function(){
                          me.field('name', $(this).val());
                          me.name= $(this).val();
                          });
    if(this.fields.name){
      nameContent.val(this.fields.name);
      me.name= $(this).val();
    } 
	 	items['昵称']=[nameContent,
	 	             $("<div></div>").addClass('row')
                .append($('<div></div>').addClass('slider').attr('name','font-size').slider(nameFontSize))
                .append($('<div></div>').css({'float':'left',padding:'5px 20px',height: '30px','line-height': '30px'}).append(nameFamily))
                .append(nameFontClolr)];
		this.configItems = $.extend(true,items['昵称'] ,this.configItems);
		
	};